let moduleA = (function () {
  let state = 1;
  function getState() {
    return state;
  }
  return { getState };
})();

let moduleB = (function () {
  let state = 2;
  function getState() {
    return state;
  }
  return { getState };
})();

console.log(moduleA.getState());
console.log(moduleB.getState());


//自执行函数
let  a = (function () {
})()
